package com.cn.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cn.mapper.CarMapper;
import com.cn.mapper.UserMapper;
import com.cn.model.CarDetail;
import com.cn.model.User;
import com.cn.service.exception.ErrorCode;
import com.cn.service.exception.ServiceException;

/**
 * 【二手车】服务类
 * 
 * @author yp
 *
 */
@Service
public class CarSerivce {

	@Autowired
	private CarMapper carMapper;

	/**
	 * 查询车辆
	 * 
	 * @param 
	 * @return
	 */
	public CarDetail queryCar(String id) {
	    /* if("222".equals(id)){
	 		throw new ServiceException("测试错误",ErrorCode.NO_TOKEN);
	     }*/
		 return carMapper.queryCar(id);
	}
	
	/**
	 * 添加新车
	 * 
	 * @param 
	 * @return
	 */
	
	public void addCar(CarDetail car) {
		
		carMapper.addCar(car);
		
		
	}

	
}
